#ifndef SPLITTEREDLAYOUT_H
#define SPLITTEREDLAYOUT_H
#include <QObject>
#include <QList>

class QWidget;
class QLayout;
class QSplitter;

namespace ExecTerminalImplNS 
{
    class SlidingWindow;
    class FavoritesPanel;
    class PanelMover;
    class CentralWidgetContainer;
    class TabButtonsPanel;
    class SplitteredLayout: public QObject
    {
        Q_OBJECT
    public: 
        SplitteredLayout(QWidget * parent);
        ~SplitteredLayout();
        QLayout * layout()const;
        void setVisibleToWidgets(bool vis);
        QWidget * centralWidget()const;
        void setCentralWidget(QWidget *);
        TabButtonsPanel * tabButtonsPanel()const { return theTabButtonsPanel; }
        FavoritesPanel * favoritesPanel()const;

    protected slots:
        void changeOrientation();
        void switchVisibility();
        void horSlidingFinished();

    protected:
        void initMainWidgets();
        void doHorLayout(bool isPanelAtLeft);
        bool eventFilter(QObject *, QEvent *);

    private:        
        QList<int> theSplitterSizes;
        QWidget * theParentWidget;
        QLayout * theMainLayout;
        QSplitter * thePanelSplitter;
        QSplitter * theVerticalSplitter;
        SlidingWindow * theLeftPanelSlider;
        FavoritesPanel * theFavoritesPanel;
        PanelMover * theLeftPanelMover;
        CentralWidgetContainer * theCentralWidgetCont;
        TabButtonsPanel * theTabButtonsPanel;
    };
}
#endif

